package com.ibm.mall.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibm.mall.dao.CommodityClassDao;
import com.ibm.mall.model.CommodityClass;
import com.ibm.mall.model.PageBean;
import com.ibm.mall.service.CommodityClassService;
import com.ibm.mall.util.QueryHelper;
/**
 * @author qiu
 * description:商品类别service层实现类
 */
@Service
@Transactional
public class CommodityClassServiceImpl implements CommodityClassService {
	
	@Resource
	private CommodityClassDao commodityClassDao;
	
	@Override
	public PageBean getPageBean(int pageNum, int pageSize, QueryHelper queryHelper) {
		return commodityClassDao.getPageBean(pageNum, pageSize, queryHelper);
	}

	@Override
	public void saveCommodityClass(CommodityClass model) {
		commodityClassDao.save(model);
	}

	@Override
	public List<CommodityClass> getTopCommodityClass() {
		return commodityClassDao.getTopCommodityClass();
	}

	@Override
	public CommodityClass getCommdityClassById(Integer commodityClassId) {
		return commodityClassDao.getById(commodityClassId);
	}

	@Override
	public void deleteCommodityClass(CommodityClass commodityClass) {
		commodityClassDao.update(commodityClass);
	}

	@Override
	public void updateCommodityClass(CommodityClass commodityClass) {
		commodityClassDao.update(commodityClass);
	}
}
